# name : normal.delta.consist.fun
# key: normal.delta.consist.fun
# contributor: Shuguang Sun
# --
${1:deltaconst} <- function(x) {
  bd <- x$delta * x$perc
  c <- sqrt(x$ratio)/(1 + x$ratio)
  delta <- c * (x$delta - bd)

  n <- (qnorm(x$prob) / delta * sd)^2
  n
}
$1(x)